﻿namespace HRM.CORE.REPORT
{
    using DevExpress.Utils;
    using DevExpress.XtraPrinting;
    using DevExpress.XtraReports.UI;
    using Dictionary.ERP;
    using HRM.CORE;
    using HRM.CORE.CLASS;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Drawing.Printing;

    public class rptShiftNightDay : XtraReport
    {
        private BottomMarginBand BottomMargin;
        private XRTableCell colD1;
        private XRTableCell colD10;
        private XRTableCell colD11;
        private XRTableCell colD12;
        private XRTableCell colD13;
        private XRTableCell colD14;
        private XRTableCell colD15;
        private XRTableCell colD16;
        private XRTableCell colD17;
        private XRTableCell colD18;
        private XRTableCell colD19;
        private XRTableCell colD2;
        private XRTableCell colD20;
        private XRTableCell colD21;
        private XRTableCell colD22;
        private XRTableCell colD23;
        private XRTableCell colD24;
        private XRTableCell colD25;
        private XRTableCell colD26;
        private XRTableCell colD27;
        private XRTableCell colD28;
        private XRTableCell colD29;
        private XRTableCell colD3;
        private XRTableCell colD30;
        private XRTableCell colD31;
        private XRTableCell colD4;
        private XRTableCell colD5;
        private XRTableCell colD6;
        private XRTableCell colD7;
        private XRTableCell colD8;
        private XRTableCell colD9;
        private XRTableCell colRealDay;
        private XRTableCell colShiftName;
        private IContainer components;
        private DetailBand Detail;
        private GroupHeaderBand GroupHeader1;
        private HRM_EMPLOYEE l_Employee;
        private DIC_SHIFT l_Shift;
        private HRM_TIMEKEEPER_SHIFT l_TimeKeeperShift;
        private HRM_TIMEKEEPER_TABLELIST l_TimeKeeperTableList;
        private string m_Code;
        private int m_Level;
        private int m_Month;
        private int m_Order;
        private int m_Year;
        private XRPictureBox ptPhoto;
        private ReportFooterBand ReportFooter;
        private ReportHeaderBand ReportHeader;
        private TopMarginBand TopMargin;
        private XRLabel txtAddress;
        private XRLabel txtCompany;
        private XRTableCell txtD1;
        private XRTableCell txtD10;
        private XRTableCell txtD11;
        private XRTableCell txtD12;
        private XRTableCell txtD13;
        private XRTableCell txtD14;
        private XRTableCell txtD15;
        private XRTableCell txtD16;
        private XRTableCell txtD17;
        private XRTableCell txtD18;
        private XRTableCell txtD19;
        private XRTableCell txtD2;
        private XRTableCell txtD20;
        private XRTableCell txtD21;
        private XRTableCell txtD22;
        private XRTableCell txtD23;
        private XRTableCell txtD24;
        private XRTableCell txtD25;
        private XRTableCell txtD26;
        private XRTableCell txtD27;
        private XRTableCell txtD28;
        private XRTableCell txtD29;
        private XRTableCell txtD3;
        private XRTableCell txtD30;
        private XRTableCell txtD31;
        private XRTableCell txtD4;
        private XRTableCell txtD5;
        private XRTableCell txtD6;
        private XRTableCell txtD7;
        private XRTableCell txtD8;
        private XRTableCell txtD9;
        private XRTableCell txtOrder;
        private XRTableCell txtShiftName;
        private XRLabel txtTitle;
        private XRLabel txtUnit;
        private XRLabel xrLabel2;
        private XRTable xrTable1;
        private XRTable xrTable2;
        private XRTableCell xrTableCell1;
        private XRTableCell xrTableCell2;
        private XRTableRow xrTableRow1;
        private XRTableRow xrTableRow2;

        public rptShiftNightDay()
        {
            this.components = null;
            this.l_TimeKeeperShift = new HRM_TIMEKEEPER_SHIFT();
            this.l_Shift = new DIC_SHIFT();
            this.l_TimeKeeperTableList = new HRM_TIMEKEEPER_TABLELIST();
            this.l_Employee = new HRM_EMPLOYEE();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_Month = 0;
            this.m_Year = 0;
            this.m_Order = 0;
            this.InitializeComponent();
        }

        public rptShiftNightDay(int Level, string Code, int Month, int Year)
        {
            this.components = null;
            this.l_TimeKeeperShift = new HRM_TIMEKEEPER_SHIFT();
            this.l_Shift = new DIC_SHIFT();
            this.l_TimeKeeperTableList = new HRM_TIMEKEEPER_TABLELIST();
            this.l_Employee = new HRM_EMPLOYEE();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_Month = 0;
            this.m_Year = 0;
            this.m_Order = 0;
            this.InitializeComponent();
            this.m_Level = Level;
            this.m_Code = Code;
            this.m_Month = Month;
            this.m_Year = Year;
        }

        private string DayName(int Year, int Month, int Day)
        {
            try
            {
                DateTime time = new DateTime(Year, Month, Day);
                return (Day.ToString() + " " + time.DayOfWeek.ToString().Substring(0, 3));
            }
            catch
            {
                return Day.ToString();
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.Detail = new DetailBand();
            this.xrTable2 = new XRTable();
            this.xrTableRow2 = new XRTableRow();
            this.txtOrder = new XRTableCell();
            this.xrTableCell1 = new XRTableCell();
            this.txtShiftName = new XRTableCell();
            this.txtD1 = new XRTableCell();
            this.txtD2 = new XRTableCell();
            this.txtD3 = new XRTableCell();
            this.txtD4 = new XRTableCell();
            this.txtD5 = new XRTableCell();
            this.txtD6 = new XRTableCell();
            this.txtD7 = new XRTableCell();
            this.txtD8 = new XRTableCell();
            this.txtD9 = new XRTableCell();
            this.txtD10 = new XRTableCell();
            this.txtD11 = new XRTableCell();
            this.txtD12 = new XRTableCell();
            this.txtD13 = new XRTableCell();
            this.txtD14 = new XRTableCell();
            this.txtD15 = new XRTableCell();
            this.txtD16 = new XRTableCell();
            this.txtD17 = new XRTableCell();
            this.txtD18 = new XRTableCell();
            this.txtD19 = new XRTableCell();
            this.txtD20 = new XRTableCell();
            this.txtD21 = new XRTableCell();
            this.txtD22 = new XRTableCell();
            this.txtD23 = new XRTableCell();
            this.txtD24 = new XRTableCell();
            this.txtD25 = new XRTableCell();
            this.txtD26 = new XRTableCell();
            this.txtD27 = new XRTableCell();
            this.txtD28 = new XRTableCell();
            this.txtD29 = new XRTableCell();
            this.txtD30 = new XRTableCell();
            this.txtD31 = new XRTableCell();
            this.TopMargin = new TopMarginBand();
            this.BottomMargin = new BottomMarginBand();
            this.ReportHeader = new ReportHeaderBand();
            this.txtTitle = new XRLabel();
            this.txtUnit = new XRLabel();
            this.txtAddress = new XRLabel();
            this.ptPhoto = new XRPictureBox();
            this.txtCompany = new XRLabel();
            this.xrLabel2 = new XRLabel();
            this.GroupHeader1 = new GroupHeaderBand();
            this.xrTable1 = new XRTable();
            this.xrTableRow1 = new XRTableRow();
            this.xrTableCell2 = new XRTableCell();
            this.colShiftName = new XRTableCell();
            this.colRealDay = new XRTableCell();
            this.colD1 = new XRTableCell();
            this.colD2 = new XRTableCell();
            this.colD3 = new XRTableCell();
            this.colD4 = new XRTableCell();
            this.colD5 = new XRTableCell();
            this.colD6 = new XRTableCell();
            this.colD7 = new XRTableCell();
            this.colD8 = new XRTableCell();
            this.colD9 = new XRTableCell();
            this.colD10 = new XRTableCell();
            this.colD11 = new XRTableCell();
            this.colD12 = new XRTableCell();
            this.colD13 = new XRTableCell();
            this.colD14 = new XRTableCell();
            this.colD15 = new XRTableCell();
            this.colD16 = new XRTableCell();
            this.colD17 = new XRTableCell();
            this.colD18 = new XRTableCell();
            this.colD19 = new XRTableCell();
            this.colD20 = new XRTableCell();
            this.colD21 = new XRTableCell();
            this.colD22 = new XRTableCell();
            this.colD23 = new XRTableCell();
            this.colD24 = new XRTableCell();
            this.colD25 = new XRTableCell();
            this.colD26 = new XRTableCell();
            this.colD27 = new XRTableCell();
            this.colD28 = new XRTableCell();
            this.colD29 = new XRTableCell();
            this.colD30 = new XRTableCell();
            this.colD31 = new XRTableCell();
            this.ReportFooter = new ReportFooterBand();
            this.xrTable2.BeginInit();
            this.xrTable1.BeginInit();
            this.BeginInit();
            this.Detail.Controls.AddRange(new XRControl[] { this.xrTable2 });
            this.Detail.HeightF = 29.16667f;
            this.Detail.Name = "Detail";
            this.Detail.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.Detail.TextAlignment = TextAlignment.TopLeft;
            this.xrTable2.Borders = BorderSide.Bottom | BorderSide.Right | BorderSide.Left;
            this.xrTable2.Font = new Font("Times New Roman", 8.25f);
            this.xrTable2.LocationFloat = new PointFloat(3.178914E-05f, 0f);
            this.xrTable2.Name = "xrTable2";
            this.xrTable2.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.xrTable2.Rows.AddRange(new XRTableRow[] { this.xrTableRow2 });
            this.xrTable2.SizeF = new SizeF(1094.5f, 29.16667f);
            this.xrTable2.StylePriority.UseBorders = false;
            this.xrTable2.StylePriority.UseFont = false;
            this.xrTable2.StylePriority.UsePadding = false;
            this.xrTable2.StylePriority.UseTextAlignment = false;
            this.xrTable2.TextAlignment = TextAlignment.MiddleLeft;
            this.xrTableRow2.Cells.AddRange(new XRTableCell[] { 
                this.txtOrder, this.xrTableCell1, this.txtShiftName, this.txtD1, this.txtD2, this.txtD3, this.txtD4, this.txtD5, this.txtD6, this.txtD7, this.txtD8, this.txtD9, this.txtD10, this.txtD11, this.txtD12, this.txtD13, 
                this.txtD14, this.txtD15, this.txtD16, this.txtD17, this.txtD18, this.txtD19, this.txtD20, this.txtD21, this.txtD22, this.txtD23, this.txtD24, this.txtD25, this.txtD26, this.txtD27, this.txtD28, this.txtD29, 
                this.txtD30, this.txtD31
             });
            this.xrTableRow2.Name = "xrTableRow2";
            this.xrTableRow2.Weight = 1.0;
            this.txtOrder.Name = "txtOrder";
            this.txtOrder.StylePriority.UseTextAlignment = false;
            this.txtOrder.Text = "txtOrder";
            this.txtOrder.TextAlignment = TextAlignment.MiddleCenter;
            this.txtOrder.Weight = 0.16817207870464784;
            this.txtOrder.BeforePrint += new PrintEventHandler(this.txtOrder_BeforePrint);
            this.xrTableCell1.Name = "xrTableCell1";
            this.xrTableCell1.Text = "[EmployeeCode]";
            this.xrTableCell1.Weight = 0.29659242498699251;
            this.txtShiftName.Font = new Font("Times New Roman", 8.25f);
            this.txtShiftName.Name = "txtShiftName";
            this.txtShiftName.StylePriority.UseFont = false;
            this.txtShiftName.Text = "[FirstName][LastName]";
            this.txtShiftName.Weight = 0.65487103314638151;
            this.txtD1.Name = "txtD1";
            this.txtD1.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD1.StylePriority.UsePadding = false;
            this.txtD1.StylePriority.UseTextAlignment = false;
            this.txtD1.Text = "[D1]";
            this.txtD1.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD1.Weight = 0.13840974605756073;
            this.txtD1.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD2.Name = "txtD2";
            this.txtD2.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD2.StylePriority.UsePadding = false;
            this.txtD2.StylePriority.UseTextAlignment = false;
            this.txtD2.Text = "[D2]";
            this.txtD2.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD2.Weight = 0.1384095971395769;
            this.txtD2.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD3.Name = "txtD3";
            this.txtD3.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD3.StylePriority.UsePadding = false;
            this.txtD3.StylePriority.UseTextAlignment = false;
            this.txtD3.Text = "[D3]";
            this.txtD3.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD3.Weight = 0.1384098935684509;
            this.txtD3.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD4.Name = "txtD4";
            this.txtD4.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD4.StylePriority.UsePadding = false;
            this.txtD4.StylePriority.UseTextAlignment = false;
            this.txtD4.Text = "[D4]";
            this.txtD4.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD4.Weight = 0.138409755105666;
            this.txtD4.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD5.Name = "txtD5";
            this.txtD5.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD5.StylePriority.UsePadding = false;
            this.txtD5.StylePriority.UseTextAlignment = false;
            this.txtD5.Text = "[D5]";
            this.txtD5.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD5.Weight = 0.1384097478916666;
            this.txtD5.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD6.Name = "txtD6";
            this.txtD6.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD6.StylePriority.UsePadding = false;
            this.txtD6.StylePriority.UseTextAlignment = false;
            this.txtD6.Text = "[D6]";
            this.txtD6.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD6.Weight = 0.13840974298476583;
            this.txtD6.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD7.Name = "txtD7";
            this.txtD7.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD7.StylePriority.UsePadding = false;
            this.txtD7.StylePriority.UseTextAlignment = false;
            this.txtD7.Text = "[D7]";
            this.txtD7.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD7.Weight = 0.13840974028699637;
            this.txtD7.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD8.Name = "txtD8";
            this.txtD8.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD8.StylePriority.UsePadding = false;
            this.txtD8.StylePriority.UseTextAlignment = false;
            this.txtD8.Text = "[D8]";
            this.txtD8.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD8.Weight = 0.13840944814593625;
            this.txtD8.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD9.Name = "txtD9";
            this.txtD9.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD9.StylePriority.UsePadding = false;
            this.txtD9.StylePriority.UseTextAlignment = false;
            this.txtD9.Text = "[D9]";
            this.txtD9.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD9.Weight = 0.13841020241922797;
            this.txtD9.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD10.Name = "txtD10";
            this.txtD10.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD10.StylePriority.UsePadding = false;
            this.txtD10.StylePriority.UseTextAlignment = false;
            this.txtD10.Text = "[D10]";
            this.txtD10.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD10.Weight = 0.13840945024313511;
            this.txtD10.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD11.Name = "txtD11";
            this.txtD11.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD11.StylePriority.UsePadding = false;
            this.txtD11.StylePriority.UseTextAlignment = false;
            this.txtD11.Text = "[D11]";
            this.txtD11.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD11.Weight = 0.13841034646551142;
            this.txtD11.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD12.Name = "txtD12";
            this.txtD12.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD12.StylePriority.UsePadding = false;
            this.txtD12.StylePriority.UseTextAlignment = false;
            this.txtD12.Text = "[D12]";
            this.txtD12.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD12.Weight = 0.13840944133760014;
            this.txtD12.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD13.Name = "txtD13";
            this.txtD13.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD13.StylePriority.UsePadding = false;
            this.txtD13.StylePriority.UseTextAlignment = false;
            this.txtD13.Text = "[D13]";
            this.txtD13.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD13.Weight = 0.13840974552712282;
            this.txtD13.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD14.Name = "txtD14";
            this.txtD14.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD14.StylePriority.UsePadding = false;
            this.txtD14.StylePriority.UseTextAlignment = false;
            this.txtD14.Text = "[D14]";
            this.txtD14.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD14.Weight = 0.13840974656231586;
            this.txtD14.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD15.Name = "txtD15";
            this.txtD15.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD15.StylePriority.UsePadding = false;
            this.txtD15.StylePriority.UseTextAlignment = false;
            this.txtD15.Text = "[D15]";
            this.txtD15.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD15.Weight = 0.138409739025535;
            this.txtD15.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD16.Name = "txtD16";
            this.txtD16.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD16.StylePriority.UsePadding = false;
            this.txtD16.StylePriority.UseTextAlignment = false;
            this.txtD16.Text = "[D16]";
            this.txtD16.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD16.Weight = 0.1384094373162314;
            this.txtD16.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD17.Name = "txtD17";
            this.txtD17.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD17.StylePriority.UsePadding = false;
            this.txtD17.StylePriority.UseTextAlignment = false;
            this.txtD17.Text = "[D17]";
            this.txtD17.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD17.Weight = 0.13841004073483876;
            this.txtD17.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD18.Name = "txtD18";
            this.txtD18.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD18.StylePriority.UsePadding = false;
            this.txtD18.StylePriority.UseTextAlignment = false;
            this.txtD18.Text = "[D18]";
            this.txtD18.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD18.Weight = 0.138409739025535;
            this.txtD18.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD19.Name = "txtD19";
            this.txtD19.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD19.StylePriority.UsePadding = false;
            this.txtD19.StylePriority.UseTextAlignment = false;
            this.txtD19.Text = "[D19]";
            this.txtD19.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD19.Weight = 0.138409456173063;
            this.txtD19.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD20.Name = "txtD20";
            this.txtD20.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD20.StylePriority.UsePadding = false;
            this.txtD20.StylePriority.UseTextAlignment = false;
            this.txtD20.Text = "[D20]";
            this.txtD20.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD20.Weight = 0.13841005959167024;
            this.txtD20.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD21.Name = "txtD21";
            this.txtD21.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD21.StylePriority.UsePadding = false;
            this.txtD21.StylePriority.UseTextAlignment = false;
            this.txtD21.Text = "[D21]";
            this.txtD21.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD21.Weight = 0.13840975788236642;
            this.txtD21.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD22.Name = "txtD22";
            this.txtD22.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD22.StylePriority.UsePadding = false;
            this.txtD22.StylePriority.UseTextAlignment = false;
            this.txtD22.Text = "[D22]";
            this.txtD22.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD22.Weight = 0.13841004073483865;
            this.txtD22.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD23.Name = "txtD23";
            this.txtD23.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD23.StylePriority.UsePadding = false;
            this.txtD23.StylePriority.UseTextAlignment = false;
            this.txtD23.Text = "[D23]";
            this.txtD23.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD23.Weight = 0.13840914503534346;
            this.txtD23.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD24.Name = "txtD24";
            this.txtD24.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD24.StylePriority.UsePadding = false;
            this.txtD24.StylePriority.UseTextAlignment = false;
            this.txtD24.Text = "[D24]";
            this.txtD24.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD24.Weight = 0.13841005016325442;
            this.txtD24.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD25.Name = "txtD25";
            this.txtD25.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD25.StylePriority.UsePadding = false;
            this.txtD25.StylePriority.UseTextAlignment = false;
            this.txtD25.Text = "[D25]";
            this.txtD25.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD25.Weight = 0.13840974845395085;
            this.txtD25.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD26.Name = "txtD26";
            this.txtD26.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD26.StylePriority.UsePadding = false;
            this.txtD26.StylePriority.UseTextAlignment = false;
            this.txtD26.Text = "[D26]";
            this.txtD26.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD26.Weight = 0.13840974845395096;
            this.txtD26.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD27.Name = "txtD27";
            this.txtD27.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD27.StylePriority.UsePadding = false;
            this.txtD27.StylePriority.UseTextAlignment = false;
            this.txtD27.Text = "[D27]";
            this.txtD27.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD27.Weight = 0.13841005016325458;
            this.txtD27.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD28.Name = "txtD28";
            this.txtD28.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD28.StylePriority.UsePadding = false;
            this.txtD28.StylePriority.UseTextAlignment = false;
            this.txtD28.Text = "[D28]";
            this.txtD28.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD28.Weight = 0.13841005016325439;
            this.txtD28.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD29.Name = "txtD29";
            this.txtD29.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD29.StylePriority.UsePadding = false;
            this.txtD29.StylePriority.UseTextAlignment = false;
            this.txtD29.Text = "[D29]";
            this.txtD29.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD29.Weight = 0.13841035275931657;
            this.txtD29.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD30.Name = "txtD30";
            this.txtD30.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD30.StylePriority.UsePadding = false;
            this.txtD30.StylePriority.UseTextAlignment = false;
            this.txtD30.Text = "[D30]";
            this.txtD30.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD30.Weight = 0.13840914592210196;
            this.txtD30.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.txtD31.Name = "txtD31";
            this.txtD31.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtD31.StylePriority.UsePadding = false;
            this.txtD31.StylePriority.UseTextAlignment = false;
            this.txtD31.Text = "[D31]";
            this.txtD31.TextAlignment = TextAlignment.MiddleCenter;
            this.txtD31.Weight = 0.13840968814947832;
            this.txtD31.BeforePrint += new PrintEventHandler(this.txtD_BeforePrint);
            this.TopMargin.HeightF = 40f;
            this.TopMargin.Name = "TopMargin";
            this.TopMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.TopMargin.TextAlignment = TextAlignment.TopLeft;
            this.BottomMargin.HeightF = 40f;
            this.BottomMargin.Name = "BottomMargin";
            this.BottomMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.BottomMargin.TextAlignment = TextAlignment.TopLeft;
            this.ReportHeader.Controls.AddRange(new XRControl[] { this.txtTitle, this.txtUnit, this.txtAddress, this.ptPhoto, this.txtCompany, this.xrLabel2 });
            this.ReportHeader.HeightF = 124f;
            this.ReportHeader.Name = "ReportHeader";
            this.txtTitle.Font = new Font("Times New Roman", 14f, FontStyle.Bold);
            this.txtTitle.LocationFloat = new PointFloat(3.178914E-05f, 68.75f);
            this.txtTitle.Name = "txtTitle";
            this.txtTitle.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtTitle.SizeF = new SizeF(1094.5f, 30.25001f);
            this.txtTitle.StylePriority.UseFont = false;
            this.txtTitle.StylePriority.UseTextAlignment = false;
            this.txtTitle.Text = "LỊCH TRỰC Đ\x00caM TH\x00c1NG 00/0000";
            this.txtTitle.TextAlignment = TextAlignment.MiddleCenter;
            this.txtUnit.LocationFloat = new PointFloat(0f, 99.00001f);
            this.txtUnit.Name = "txtUnit";
            this.txtUnit.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtUnit.SizeF = new SizeF(1094.5f, 17.70834f);
            this.txtUnit.StylePriority.UseTextAlignment = false;
            this.txtUnit.TextAlignment = TextAlignment.MiddleCenter;
            this.txtAddress.LocationFloat = new PointFloat(154.3333f, 31.70837f);
            this.txtAddress.Name = "txtAddress";
            this.txtAddress.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtAddress.SizeF = new SizeF(413.3749f, 17.70833f);
            this.txtAddress.StylePriority.UseTextAlignment = false;
            this.txtAddress.Text = "txtAddress";
            this.txtAddress.TextAlignment = TextAlignment.MiddleLeft;
            this.ptPhoto.LocationFloat = new PointFloat(9.000008f, 3.999996f);
            this.ptPhoto.Name = "ptPhoto";
            this.ptPhoto.SizeF = new SizeF(94.50658f, 58.54166f);
            this.ptPhoto.Sizing = ImageSizeMode.ZoomImage;
            this.txtCompany.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtCompany.LocationFloat = new PointFloat(105.5417f, 10.00001f);
            this.txtCompany.Name = "txtCompany";
            this.txtCompany.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtCompany.SizeF = new SizeF(458.1665f, 17.70833f);
            this.txtCompany.StylePriority.UseFont = false;
            this.txtCompany.StylePriority.UseTextAlignment = false;
            this.txtCompany.Text = "txtCompany";
            this.txtCompany.TextAlignment = TextAlignment.MiddleLeft;
            this.xrLabel2.LocationFloat = new PointFloat(105.5417f, 31.70827f);
            this.xrLabel2.Name = "xrLabel2";
            this.xrLabel2.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel2.SizeF = new SizeF(48.7916f, 17.70833f);
            this.xrLabel2.StylePriority.UseTextAlignment = false;
            this.xrLabel2.Text = "Địa chỉ:";
            this.xrLabel2.TextAlignment = TextAlignment.MiddleLeft;
            this.GroupHeader1.Controls.AddRange(new XRControl[] { this.xrTable1 });
            this.GroupHeader1.HeightF = 34.16665f;
            this.GroupHeader1.Name = "GroupHeader1";
            this.GroupHeader1.RepeatEveryPage = true;
            this.xrTable1.AnchorVertical = VerticalAnchorStyles.Bottom;
            this.xrTable1.BackColor = Color.WhiteSmoke;
            this.xrTable1.Borders = BorderSide.All;
            this.xrTable1.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.xrTable1.LocationFloat = new PointFloat(3.178914E-05f, 0f);
            this.xrTable1.Name = "xrTable1";
            this.xrTable1.Rows.AddRange(new XRTableRow[] { this.xrTableRow1 });
            this.xrTable1.SizeF = new SizeF(1094.5f, 34.16665f);
            this.xrTable1.StylePriority.UseBackColor = false;
            this.xrTable1.StylePriority.UseBorders = false;
            this.xrTable1.StylePriority.UseFont = false;
            this.xrTable1.StylePriority.UseTextAlignment = false;
            this.xrTable1.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableRow1.Cells.AddRange(new XRTableCell[] { 
                this.xrTableCell2, this.colShiftName, this.colRealDay, this.colD1, this.colD2, this.colD3, this.colD4, this.colD5, this.colD6, this.colD7, this.colD8, this.colD9, this.colD10, this.colD11, this.colD12, this.colD13, 
                this.colD14, this.colD15, this.colD16, this.colD17, this.colD18, this.colD19, this.colD20, this.colD21, this.colD22, this.colD23, this.colD24, this.colD25, this.colD26, this.colD27, this.colD28, this.colD29, 
                this.colD30, this.colD31
             });
            this.xrTableRow1.Name = "xrTableRow1";
            this.xrTableRow1.Weight = 1.0;
            this.xrTableCell2.CanGrow = false;
            this.xrTableCell2.Name = "xrTableCell2";
            this.xrTableCell2.Text = "STT";
            this.xrTableCell2.Weight = 0.16817216787843536;
            this.colShiftName.CanGrow = false;
            this.colShiftName.Name = "colShiftName";
            this.colShiftName.Text = "M\x00e3 NV";
            this.colShiftName.Weight = 0.29659235641487308;
            this.colRealDay.CanGrow = false;
            this.colRealDay.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.colRealDay.Name = "colRealDay";
            this.colRealDay.StylePriority.UseFont = false;
            this.colRealDay.Text = "Họ v\x00e0 t\x00ean";
            this.colRealDay.Weight = 0.65487109145591271;
            this.colD1.CanGrow = false;
            this.colD1.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.colD1.Name = "colD1";
            this.colD1.StylePriority.UseFont = false;
            this.colD1.StylePriority.UseTextAlignment = false;
            this.colD1.Text = "1";
            this.colD1.TextAlignment = TextAlignment.MiddleCenter;
            this.colD1.Weight = 0.13840996512967341;
            this.colD2.CanGrow = false;
            this.colD2.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.colD2.Name = "colD2";
            this.colD2.StylePriority.UseFont = false;
            this.colD2.StylePriority.UseTextAlignment = false;
            this.colD2.Text = "2";
            this.colD2.TextAlignment = TextAlignment.MiddleCenter;
            this.colD2.Weight = 0.13840977859730591;
            this.colD3.CanGrow = false;
            this.colD3.Name = "colD3";
            this.colD3.Text = "3";
            this.colD3.Weight = 0.13840978217209426;
            this.colD4.CanGrow = false;
            this.colD4.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.colD4.Name = "colD4";
            this.colD4.StylePriority.UseFont = false;
            this.colD4.StylePriority.UseTextAlignment = false;
            this.colD4.Text = "4";
            this.colD4.TextAlignment = TextAlignment.MiddleCenter;
            this.colD4.Weight = 0.13840977920863926;
            this.colD5.CanGrow = false;
            this.colD5.Name = "colD5";
            this.colD5.Text = "5";
            this.colD5.Weight = 0.13840978225399231;
            this.colD6.CanGrow = false;
            this.colD6.Name = "colD6";
            this.colD6.Text = "6";
            this.colD6.Weight = 0.13840977859933662;
            this.colD7.CanGrow = false;
            this.colD7.Name = "colD7";
            this.colD7.Text = "7";
            this.colD7.Weight = 0.13840978331353757;
            this.colD8.CanGrow = false;
            this.colD8.Name = "colD8";
            this.colD8.Text = "8";
            this.colD8.Weight = 0.13840977937456297;
            this.colD9.CanGrow = false;
            this.colD9.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.colD9.Name = "colD9";
            this.colD9.StylePriority.UseFont = false;
            this.colD9.StylePriority.UseTextAlignment = false;
            this.colD9.Text = "9";
            this.colD9.TextAlignment = TextAlignment.MiddleCenter;
            this.colD9.Weight = 0.13840977937456317;
            this.colD10.CanGrow = false;
            this.colD10.Name = "colD10";
            this.colD10.Text = "10";
            this.colD10.Weight = 0.13840978319943073;
            this.colD11.CanGrow = false;
            this.colD11.Name = "colD11";
            this.colD11.Text = "11";
            this.colD11.Weight = 0.13840977501944171;
            this.colD12.CanGrow = false;
            this.colD12.Name = "colD12";
            this.colD12.Text = "12";
            this.colD12.Weight = 0.138409775019441;
            this.colD13.CanGrow = false;
            this.colD13.Name = "colD13";
            this.colD13.Text = "13";
            this.colD13.Weight = 0.13840977460329865;
            this.colD14.CanGrow = false;
            this.colD14.Name = "colD14";
            this.colD14.Text = "14";
            this.colD14.Weight = 0.1384097716518915;
            this.colD15.CanGrow = false;
            this.colD15.Name = "colD15";
            this.colD15.Text = "15";
            this.colD15.Weight = 0.13840978269016307;
            this.colD16.CanGrow = false;
            this.colD16.Name = "colD16";
            this.colD16.Text = "16";
            this.colD16.Weight = 0.13840978269016327;
            this.colD17.CanGrow = false;
            this.colD17.Name = "colD17";
            this.colD17.Text = "17";
            this.colD17.Weight = 0.13840978269016338;
            this.colD18.CanGrow = false;
            this.colD18.Name = "colD18";
            this.colD18.Text = "18";
            this.colD18.Weight = 0.13840978269016327;
            this.colD19.CanGrow = false;
            this.colD19.Name = "colD19";
            this.colD19.Text = "19";
            this.colD19.Weight = 0.13840976383332726;
            this.colD20.CanGrow = false;
            this.colD20.Name = "colD20";
            this.colD20.Text = "20";
            this.colD20.Weight = 0.1384097638333272;
            this.colD21.CanGrow = false;
            this.colD21.Name = "colD21";
            this.colD21.Text = "21";
            this.colD21.Weight = 0.13840976383332729;
            this.colD22.CanGrow = false;
            this.colD22.Name = "colD22";
            this.colD22.Text = "22";
            this.colD22.Weight = 0.13840976383332726;
            this.colD23.CanGrow = false;
            this.colD23.Name = "colD23";
            this.colD23.Text = "23";
            this.colD23.Weight = 0.13840978010425772;
            this.colD24.CanGrow = false;
            this.colD24.Name = "colD24";
            this.colD24.Text = "24";
            this.colD24.Weight = 0.13840978056185974;
            this.colD25.CanGrow = false;
            this.colD25.Name = "colD25";
            this.colD25.Text = "25";
            this.colD25.Weight = 0.13840977797595422;
            this.colD26.CanGrow = false;
            this.colD26.Name = "colD26";
            this.colD26.Text = "26";
            this.colD26.Weight = 0.13840977797595416;
            this.colD27.CanGrow = false;
            this.colD27.Name = "colD27";
            this.colD27.Text = "27";
            this.colD27.Weight = 0.13840977797595427;
            this.colD28.CanGrow = false;
            this.colD28.Name = "colD28";
            this.colD28.Text = "28";
            this.colD28.Weight = 0.1384097826901633;
            this.colD29.CanGrow = false;
            this.colD29.Name = "colD29";
            this.colD29.Text = "29";
            this.colD29.Weight = 0.13840977592891468;
            this.colD30.CanGrow = false;
            this.colD30.Name = "colD30";
            this.colD30.Text = "30";
            this.colD30.Weight = 0.13840977592891451;
            this.colD31.CanGrow = false;
            this.colD31.Name = "colD31";
            this.colD31.Text = "31";
            this.colD31.Weight = 0.1384097759289149;
            this.ReportFooter.HeightF = 6f;
            this.ReportFooter.Name = "ReportFooter";
            base.Bands.AddRange(new Band[] { this.Detail, this.TopMargin, this.BottomMargin, this.ReportHeader, this.GroupHeader1, this.ReportFooter });
            base.Font = new Font("Times New Roman", 9.75f);
            base.Landscape = true;
            base.Margins = new Margins(0x2c, 30, 40, 40);
            base.PageHeight = 0x33b;
            base.PageWidth = 0x491;
            base.PaperKind = PaperKind.A4;
            this.TextAlignment = TextAlignment.TopCenter;
            base.Version = "9.3";
            this.BeforePrint += new PrintEventHandler(this.rptListEmployee_BeforePrint);
            this.xrTable2.EndInit();
            this.xrTable1.EndInit();
            this.EndInit();
        }

        private void InitInterface()
        {
            int numberDay = DateTime.DaysInMonth(this.m_Year, this.m_Month);
            this.ShowHideColumn(numberDay);
            for (int i = 1; i <= numberDay; i++)
            {
                DateTime date = new DateTime(this.m_Year, this.m_Month, i);
                clsTimeKeeperOption option = new clsTimeKeeperOption();
                if (date.DayOfWeek.ToString() == "Monday")
                {
                    this.xrTableRow2.Cells[i + 2].BackColor = option.MondayColor;
                }
                else if (date.DayOfWeek.ToString() == "Tuesday")
                {
                    this.xrTableRow2.Cells[i + 2].BackColor = option.TuesdayColor;
                }
                else if (date.DayOfWeek.ToString() == "Wednesday")
                {
                    this.xrTableRow2.Cells[i + 2].BackColor = option.WednesdayColor;
                }
                else if (date.DayOfWeek.ToString() == "Thursday")
                {
                    this.xrTableRow2.Cells[i + 2].BackColor = option.ThursdayColor;
                }
                else if (date.DayOfWeek.ToString() == "Friday")
                {
                    this.xrTableRow2.Cells[i + 2].BackColor = option.FridayColor;
                }
                else if (date.DayOfWeek.ToString() == "Saturday")
                {
                    this.xrTableRow2.Cells[i + 2].BackColor = option.SaturdayColor;
                }
                else if (date.DayOfWeek.ToString() == "Sunday")
                {
                    this.xrTableRow2.Cells[i + 2].BackColor = option.SundayColor;
                }
                DIC_HOLIDAY dic_holiday = new DIC_HOLIDAY();
                if (dic_holiday.Exist(date))
                {
                    this.xrTableRow2.Cells[i + 2].BackColor = option.HolidayColor;
                }
                this.xrTableRow1.Cells[i + 2].Text = this.DayName(this.m_Year, this.m_Month, i);
            }
        }

        private void LoadAllData()
        {
            this.InitInterface();
            this.l_TimeKeeperTableList.Get(this.m_Month, this.m_Year);
            DateTime time = new DateTime(this.m_Year, this.m_Month, 1);
            DateTime time2 = new DateTime(this.m_Year, this.m_Month, DateTime.DaysInMonth(this.m_Year, this.m_Month));
            DataSet set = new DataSet();
            DataTable table = new DataTable();
            table = this.l_TimeKeeperShift.GetList(this.m_Level, this.m_Code, this.l_TimeKeeperTableList.TimeKeeperTableListID, true, true);
            if (this.m_Level != 0)
            {
                if (this.m_Level == 1)
                {
                    HRM_BRANCH hrm_branch = new HRM_BRANCH();
                    hrm_branch.Get(this.m_Code);
                    this.txtUnit.Text = "Đơn vị: " + hrm_branch.BranchName;
                }
                else if (this.m_Level == 2)
                {
                    HRM_DEPARTMENT hrm_department = new HRM_DEPARTMENT();
                    hrm_department.Get(this.m_Code);
                    this.txtUnit.Text = "Đơn vị: " + hrm_department.DepartmentName;
                }
                else if (this.m_Level == 3)
                {
                    HRM_GROUP hrm_group = new HRM_GROUP();
                    hrm_group.Get(this.m_Code);
                    this.txtUnit.Text = "Đơn vị: " + hrm_group.GroupName;
                }
            }
            set.Tables.Add(table);
            base.DataSource = set;
            base.DataAdapter = table;
            base.DataMember = table.TableName;
        }

        private void rptListEmployee_BeforePrint(object sender, PrintEventArgs e)
        {
            this.txtTitle.Text = "LỊCH TRỰC Đ\x00caM TH\x00c1NG " + this.m_Month.ToString() + "/" + this.m_Year.ToString();
            this.LoadAllData();
            //if (MyInfo.Get(MyEncryption.Encrypt("ERP01", "123654", true)) == "OK")
            {
                this.txtCompany.Text = "";//MyInfo.Company.ToUpper();
                this.txtAddress.Text = "";//MyInfo.Address;
                this.ptPhoto.Image = null;//MyInfo.Photo;
            }
            CreateFooterReport.CreateFooter("IsTimekeeper", this.ReportFooter, this);
        }

        private void ShowHideColumn(int NumberDay)
        {
            switch (NumberDay)
            {
                case 0x1c:
                    this.xrTableRow1.Cells.Remove(this.colD31);
                    this.xrTableRow2.Cells.Remove(this.txtD31);
                    this.xrTableRow1.Cells.Remove(this.colD30);
                    this.xrTableRow2.Cells.Remove(this.txtD30);
                    this.xrTableRow1.Cells.Remove(this.colD29);
                    this.xrTableRow2.Cells.Remove(this.txtD29);
                    break;

                case 0x1d:
                    this.xrTableRow1.Cells.Remove(this.colD31);
                    this.xrTableRow2.Cells.Remove(this.txtD31);
                    this.xrTableRow1.Cells.Remove(this.colD30);
                    this.xrTableRow2.Cells.Remove(this.txtD30);
                    break;

                case 30:
                    this.xrTableRow1.Cells.Remove(this.colD31);
                    this.xrTableRow2.Cells.Remove(this.txtD31);
                    break;
            }
        }

        private void txtD_BeforePrint(object sender, PrintEventArgs e)
        {
            XRTableCell cell = sender as XRTableCell;
            if (cell.Text == "True")
            {
                cell.Text = "X";
            }
            else
            {
                cell.Text = "";
            }
        }

        private void txtOrder_BeforePrint(object sender, PrintEventArgs e)
        {
            this.m_Order++;
            this.txtOrder.Text = this.m_Order.ToString();
        }
    }
}

